package com.panghu.utils;

import com.panghu.entity.ApiResult;

public class ApiResultHandler {

    public static ApiResult success(Object object){
        ApiResult<Object> api = new ApiResult<>();
        api.setCode(200);
        api.setMessage("请求成功");
        api.setData(object);
        return api;
    }

    public static ApiResult success(){
        return success(null);
    }

    public static  <T> ApiResult buildApiResult(Integer code,String message,T data){
        ApiResult api = new ApiResult();
        api.setCode(code);
        api.setMessage(message);
        api.setData(data);
        return api;
    }

}
